#include "App_GetTime.h"
#include <stdlib.h>
#include <stdio.h>

void App_GetTime_Init(void)
{
    datetime_t time = {0};
    time.year = 25;
    time.month = 3;
    time.date = 24;
    time.hour = 23;
    time.minute = 30;
    time.second = 0;
    time.day = Monday;
    Inf_DS1302_WriteTime(&time);
}

char *App_GetTime_GetTime(void)
{
    datetime_t time = {0};
    char *time_str = malloc(30);
    Inf_DS1302_ReadTime(&time);
    sprintf(time_str, "20%02d-%02d-%02d %02d:%02d", time.year, time.month, time.date, 
                                                    time.hour, time.minute);
    return time_str;
}
